import { defineStore } from "pinia";
import { darkTheme, zhCN, dateZhCN } from "naive-ui";
import store from "@/store";
import type { GlobalThemeOverrides, GlobalTheme } from "naive-ui";
const useDesignSettingStore = defineStore("designSetting", {
  state: () => {
    return {
      theme: <GlobalTheme | null>null,
      appTheme: "#3B73FA",
      localeObj: {
        locale: zhCN,
        dateLocale: dateZhCN,
      },
    };
  },
  getters: {
    themeOverrides(): GlobalThemeOverrides {
      return {
        common: {
          primaryColor: this.appTheme,
          bodyColor: "#F5F6FA",
          cardColor: "#fff",
        },
      };
    },
  },
  actions: {
    setDarkTheme() {
      this.theme = darkTheme;
    },
    setDefaultTheme() {
      this.theme = null;
    },
  },
});
export default function useDesignSettingStoreHook() {
  return useDesignSettingStore(store);
}
